{% extends "base_generic.html" %}

{% block content %}

{% if is_admin %}<a href='/admin/blog/new'>New Blog</a> {% endif %} &nbsp;&nbsp;{% if is_admin %}<a href='/admin/category/new'>New Category</a>{% endif %}
{% for blog in Blogs %}
<div class="post">
	<div class="post-title">
		<h2> <a href='/blog/show/{{ blog.key.id }}'>{{ blog.title }}</a></h2>
		<span class="post-dates">Published at: {{ blog.date }} by {{blog.author}}</span>
		<span class="post-comments"><a href="/blog/show/{{ blog.key }}#comments">{{ blog.comments.count}} Comment</a></span> 
		
		<!--<span class="post-comments">Category:{{ blog.category.name }}</span>  -->
	</div>
	<div class="entry">
		<p>{{ blog.content }}
	</div>
</div>	
{% endfor %}

<div id="page_panel">
{% if show_page_panel %}
	{% if show_prev_page %}
		{% if not have_cat %}
			<a href='/page/{{ prev_page_num }}'><span style="font-size:9px;">&lt;&lt;</span> Prev </a>
		{% else %}
			<a href='/page/{{ prev_page_num }}/category/{{ category_id }}'><span style="font-size:9px;">&lt;&lt;</span> Prev </a>
		{% endif %}
	{% endif %}
	{% if show_next_page %}
		{% if not have_cat %}
			<a href='/page/{{ next_page_num }}'> Next <span style="font-size:9px;">&gt;&gt;</span></a>
		{% else %}
			<a href='/page/{{ next_page_num }}/category/{{ category_id }}'> Next <span style="font-size:9px;">&gt;&gt;</span></a>
		{% endif %}
	{% endif %}
{% endif %}
</div>
{% endblock content %}
